package cc.armin.impl;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import cc.armin.dataset.StudentDateSet;
import cc.armin.entity.StudentListVo;
import cc.armin.entity.StudentVo;
import cc.armin.entity.User;
import cc.armin.service.IStudentService;
import cc.armin.service.UserService;

@Component("studentService")
public class IStudentServiceImpl implements IStudentService {

	@Autowired
	private StudentDateSet studentDateSet;
	
    public String getStatus() {
        return "getStatus";
    }

  
    public StudentVo getStudentById(Integer id) {
    	System.out.println("sdf");
    	UserServiceImpl userService = new UserServiceImpl();
		User user = userService.getUser(id.toString());
		
		StudentVo vo = new StudentVo(user.getId(), user.getName(), 123, user.getMobile(), true);
		
        
		/*List<StudentVo> studentList = StudentDateSet.getList();
        StudentVo vo = null;
        if (studentList.size() > id) {
            vo = studentList.get(id - 1);
        }*/
		
        return vo;
    }

   
	public StudentListVo getStudentList() {
		List<StudentVo> studentList = StudentDateSet.getList();
		StudentListVo listVo = new StudentListVo(studentList);
		return listVo;
	}


	@Override
	public String getStatus(Integer id) {
		// TODO Auto-generated method stub
		return "getStatus" + id;
	}

}
